<!-- 
 - Copyright 2012 OmniFaces.
 -
 - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 - the License. You may obtain a copy of the License at
 -
 -     http://www.apache.org/licenses/LICENSE-2.0
 -
 - Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 - an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 - specific language governing permissions and limitations under the License.
 -->
<!DOCTYPE html>
<html lang="en"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui"
	xmlns:o="http://omnifaces.org/ui"
	xmlns:of="http://omnifaces.org/functions"
>
    <!-- Client templates can insert f:metadata here, and this will NOT show up in the showcase page source code -->
    <ui:insert name="meta"/>

    <!-- Client templates can insert f:metadata here, and this will show up in the showcase page source code -->
    <ui:insert name="demo-meta"/>

	<c:set var="_omniFacesVersion" value="#{app.version.split('\\-')[0]}" scope="application" />
	<c:set var="_docVersionPath" value="#{app.snapshot ? '' : of:concat(app.version.substring(0, 3), '/')}" scope="application" />
	<c:set var="_srcVersionParam" value="#{app.snapshot ? '' : of:concat('?name=', app.version)}" scope="application" />
	<c:set var="_apiURL" value="http://wiki.omnifaces.googlecode.com/hg/javadoc/#{_docVersionPath}" scope="application" />
	<c:set var="_vdlURL" value="http://wiki.omnifaces.googlecode.com/hg/vdldoc/#{_docVersionPath}" scope="application" />
	<c:set var="_srcURL" value="http://code.google.com/p/omnifaces/source/browse/src/" scope="application" />

	<h:head>
		<title><ui:insert name="title">OmniFaces Showcase</ui:insert></title>
		<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
		<link rel="shortcut icon" href="#{request.contextPath}/favicon.ico" />
		<h:outputScript>
			var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-29559297-3']);
			_gaq.push(['_trackPageview']);
		
			(function() {
				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
			})();
		</h:outputScript>
	</h:head>

	<h:body>
		<h:outputStylesheet library="layout" name="css/layout.css" />

		<p:panel id="header" styleClass="ui-widget-header">
			<h1>
				<a href="#{request.contextPath}/">
					<h:graphicImage library="layout" name="img/logo-70x70.png" alt="logo" width="70" height="70" />
					OmniFaces Showcase <h:outputText value="SNAPSHOT" styleClass="snapshot" rendered="#{app.snapshot}" />
				</a>
			</h1>
			<div id="poweredBy">
				<strong>Powered by</strong>
				#{app.poweredBy}
				Server (re)started at #{of:formatDateWithTimezone(startup, 'd MMM yyyy HH:mm', 'UTC')} UTC
			</div>
		</p:panel>

		<p:panel id="content">
			<h2 id="contentTitle"><ui:insert name="contentTitle">#{page.current.title}</ui:insert></h2>
			<ui:insert name="content" />
		</p:panel>

		<p:panel id="menu">
			<p:panel id="panel" header="omnifaces">
				<ul>
					<li><a href="#{request.contextPath}/" class="#{view.viewId == '/index.xhtml' ? 'active' : ''}">What is OmniFaces?</a></li>
					<li><a href="http://code.google.com/p/omnifaces">Project homepage</a></li>
					<li><a href="#{_apiURL}index.html">API documentation</a></li>
					<li><a href="#{_vdlURL}index.html">VDL documentation</a></li>
					<li><a href="#{request.contextPath}/whatsnew" class="#{view.viewId == '/whatsnew.xhtml' ? 'active' : ''}">What's new in OmniFaces #{_omniFacesVersion}?</a></li>
				</ul>
			</p:panel>
			<o:tree id="menu_tree" value="#{app.menu}" varNode="_page">
				<o:treeNode level="0">
					<o:treeNodeItem>
						<p:panel id="panel" header="#{_page.title}">
							<o:treeInsertChildren />
						</p:panel>
					</o:treeNodeItem>
				</o:treeNode>
				<o:treeNode>
					<ul><!-- class="group clearleft" -->
						<o:treeNodeItem>
							<li><h:link value="#{_page.title}" outcome="#{_page.viewId}" styleClass="code#{_page == page.current ? ' active' : ''}" /></li>
						</o:treeNodeItem>
					</ul>
				</o:treeNode>
			</o:tree>
		</p:panel>
	</h:body>
</html>